import java.util.Scanner;

public class demo7 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
            System.out.println("请输入性别（男或者女）：");
            char ch=input.next().charAt(0);
            if (ch!='男'||ch!='女'){
                 throw new RuntimeException("性别必须是男或者女");
            }
    }
}
